#include <regx52.h>

unsigned char Data=0x55;
unsigned char count=0;
unsigned int Flag=0;
void Timer_Init(void)
{
	TMOD=0x02;
    TL0=0x9c;
    TH0=0x9c;
    ET0=1;
    EA=1;
    TR0=1;
}

unsigned char reverse(unsigned char a)
{

    unsigned char b=0;
	int i=0;
    for(i=0;i<8;i++)
    b|=((a&(0x01<<i))>>i)<<(7-i);
    
    return b;
}

void main()
{
	Timer_Init();
	P1=Data;
	P2=reverse(Data);
	while(1)
	{
		
	}
}


void time0_service(void) interrupt 1
{
	count++;
	Flag++;
	if(count==10)
	{
		count=0;
		P0_0=~P0_0;
	}
	if(Flag==10000)
	{
		Flag=0;
		P1=~P1;
		P2=~P2;
	}
}

